<script  lang="ts">
// 如使用  script setup lang="ts" 在微信小程序中使用 globalData 会报错 Cannot read property 'globalData' of undefined
import { MiniProgramUpdate } from '@/utils/uni.public';
import { InitializeMiniProgram } from './InitializeMiniProgram';
export default {
  globalData:{
    StartupParameter:{},// 启动带入的参数
    SystemInitialization:()=>{},// 系统初始化状态
    InitializeMiniProgram:new InitializeMiniProgram(), // 初始化东西
  },
  onLaunch(data:UniApp.GetLaunchOptionsSyncOptions){ // 此处和获取启动参数
    //console.log('App Launch',uni.getLaunchOptionsSync(),data.query);
    this.globalData.StartupParameter = data.query
    this.globalData.SystemInitialization = ():Promise<void>=>{
      return  new Promise<void>(async(resolve,reject)=>{
        // 初始化逻辑放此处


        resolve()
      })
    }
  },
onShow(){
  console.log('App Show');

  // 小程序检测更新
  //#ifndef APP || H5 || APP-IOS || APP-ANDROID || APP-NVUE || APP-PLUS-NVUE || APP-PLUS || UNI-APP-X
  MiniProgramUpdate();
  // #endif
},
onHide(){
  console.log('App Hide');
}
}
</script>
<style></style>
